package jit.hf.agriculture.controller;

import jit.hf.agriculture.Service.TestUserService;
import jit.hf.agriculture.domain.TestUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Auther: zj
 * @Date: 2018/8/7 14:04
 * @Description:
 */
@RestController
public class RedisTestController {

    @Autowired
    private TestUserService testUserService;

    @RequestMapping("/query/{id}")
    public Object query(@PathVariable int id) {
        return testUserService.findById(id);
    }

    @RequestMapping("/save")
    public Object save(@ModelAttribute TestUser testUser) {
        return testUserService.save(testUser);
    }

    @RequestMapping("/delete/{id}")
    public Object delete(@PathVariable int id) {
        return testUserService.delete(id);
    }


}
